#include "stm32f10x.h"
#include "Delay.h"
#include "FreeRTOS.h"
#include "Task.h"
_Delay Delay;
extern bool isSystemRun;//操作系统是否启动
void _Delay::us(unsigned int t)
{
	t<<=3;
	while(t--);
}
void _Delay::ms(unsigned int t)
{
  if(isSystemRun)
    vTaskDelay(t/portTICK_RATE_MS);
  else
  {
    for(int i=0;i<t;i++)
      us(1000);
  }
}
_Delay::_Delay()
{
  
}
